package com.hyst.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.hyst.model.PersonProduceRealTrendView;

public interface Person_Produce_Real_Trend_Repository extends  JpaRepository<PersonProduceRealTrendView, String>  {

	@Query(value = "SELECT id, count(DATE_FORMAT(real_finish_time,'%Y-%m-%d')) as real_task_count, sum(complete_count) as real_output_count, sum(process_hours) as real_hour, DATE_FORMAT(real_finish_time,'%Y-%m-%d') as real_finish_time FROM process_record WHERE worker_id =?1  AND real_begin_time >=?2  AND real_finish_time <=?3 GROUP BY DATE_FORMAT(real_finish_time,'%Y-%m-%d'),id,real_finish_time  ", nativeQuery = true)
	List<PersonProduceRealTrendView> findAllByUserID(String worker_id, String starttime, String endtime);
}
